#ifndef LINEAR_SUM_ASSIGNMENT_H
#define LINEAR_SUM_ASSIGNMENT_H

#include "multi_camera_cooperation/math_tools.h"
#include "multi_camera_cooperation/Assignment/hungarian_optimizer.h"
#include <limits>
#include <iostream>
#include <algorithm>

void linear_sum_assignment(const vector<cv::Point2f> &marker_pixels_left, const vector<cv::Point2f> &marker_pixels_right, vector<cv::Point2f> &marker_pixels_left_buffer, vector<cv::Point2f> &marker_pixels_right_buffer, vector<vector<double>> &match_evalution, double distance_threshold);
/**
 * @brief Update the costs matrix of hungarian optimizer.
 *
 * @param association_mat The association matrix of tracks and objects, which
 * represents the bipartite graph to be optimized.
 * @param costs The costs matrix of hungarian optimizer.
 */
void UpdateCosts(const std::vector<std::vector<double>>& association_mat, SecureMat<double>* costs);

/**
 * @brief Print the assignments result.
 *
 * @param assignments Assignments result to be printed.
 */
void PrintAssignments(const std::vector<std::pair<size_t, size_t>>& assignments);

#endif //LINEAR_SUM_ASSIGNMENT_H